home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 5 / Amiga Plus Sonderheft 1996 #5.iso / programme / imagedesk304 / import_ps / import_ps1.idesk < prev    next >
Text File  |  1996-05-02  |  2KB  |  83 lines

  1. /* ---------------- ARexx-Script zur Uebergabe eines Bildes an PageStream 3.0i ------------ */
  2. /* ------------------------------------- Version 1.0 -------------------------------------- */
  3. /* ------------------- von Volkmar Funke -- EMail: Volkmar_Funke@BN.maus.de ----------------*/
  4. /* --- Dieses ARexx-Script importiert ein ausgewaehltes Bild von ImageDesk in PageStream ---*/
  5. /* ------ mit Beruecksichtigung, das PageStream kein JPEG unterstuetzt (Zusatzmodul) -------*/
  6.  
  7.  
  8.  
  9. OPTIONS RESULTS
  10. PARSE ARG iname itype ipos
  11.  
  12.  
  13. /* Sicherstellung das ARexx supportet ist */
  14.  
  15. if ~show('L','rexxsupport.library') then
  16.         CALL ADDLIB('rexxsupport.library',0,-30)
  17. if ~show('L','softlogik:libs/slarexxsupport.library') then
  18.         CALL ADDLIB('softlogik:libs/slarexxsupport.library', 0, -30)
  19.  
  20. if ~show(P, 'PAGESTREAM') then do  /* Fehlermeldung falls PageStream nicht gestartet ist*/
  21.         ADDRESS 'IDESK_REXXPORT'
  22.         IDREQUEST "OK" '"PageStream nicht gestartet"'
  23.         EXIT
  24. end
  25.  
  26. if '"'||itype||'"' == '"JPG"' then do
  27.       ADDRESS 'IDESK_REXXPORT'
  28.         IDREQUEST "OK" '" PageStream unterstuetzt kein JPEG-Format "'
  29.         signal cancel
  30. end
  31.  
  32.  
  33. ADDRESS 'PAGESTREAM'
  34.  
  35. /* Uebergabe der Grafik, falls kein Dokument geoeffnet Fehlermeldung */
  36.  
  37. 'refresh wait'
  38. placegraphic FILE '"'||iname||'"'
  39. if rc~=0 then do
  40.  
  41.     ADDRESS 'IDESK_REXXPORT'
  42.     IDREQUEST "OK" '"Kein Dokument in PageStream offen"'
  43.     signal cancel
  44. end
  45.  
  46. /* Typfestlegung und Anfrage ob ausgelgert werden soll */
  47.  
  48. 'getobject type objtype'
  49. objnum=result
  50. trace ?i
  51.  
  52. /* Position und Groesse festlegen, wie in PageStream 2.2 */
  53.  
  54. getregion coord message '" Klicke Position und/oder ziehe Groesse. "'
  55. if rc=10 then do
  56.         'deleteobject'
  57.         signal cancel
  58. end
  59. if (abs(p2d(coord.x1)-p2d(coord.x2)))<0.25 | (abs(p2d(coord.y1)-p2d(coord.y2)))<0.25 then DO
  60.         if objtype=12 then getpicture position pstem
  61.         if objtype=2 then getdrawing position pstem
  62.         if objtype=13 then geteps position pstem
  63.         coord.x2=p2d(pstem.right)+p2d(coord.x1)
  64.         coord.y2=p2d(pstem.bottom)+p2d(coord.y1)
  65. end
  66.  
  67.  
  68. if objtype=12 then editpicture position coord.x1 coord.y1 coord.x2 coord.y2
  69. if objtype=2 then editdrawing position coord.x1 coord.y1 coord.x2 coord.y2
  70. if objtype=13 then editeps position coord.x1 coord.y1 coord.x2 coord.y2
  71.  
  72. 'refresh continue'
  73.  
  74. EXIT
  75.  
  76.  
  77. CANCEL:
  78.  
  79. ADDRESS 'PAGESTREAM' /* Muss durchgefuehrt werden, sonst keine Darstellung wenn neues */
  80. 'refresh continue'   /* Dokument geoeffnet wird */
  81.   EXIT
  82.  
  83.